Skip to content

Instantly share code, notes, and snippets.

@kshepp
kshepp / repeatable_content.html
Last active May 17, 2024 05:28
Django Header, Navbar, and Footer
<!-- This loads of all of files that you call below from your 'static' folder -->
{% load staticfiles %}
<!--The static folder consists of your bootstrap files (.css, .js, fonts, etc)-->
<!--When you load the static folders is calls all those folders in the static files without having to code each one in individually-->
<html>
<head>
<!--This is the meta information which is good for SEO-->
{% block head-meta %}
<meta charset="utf-8">
@codeSTACKr
codeSTACKr / mongodb_cheat_sheet_2022.md
Created January 10, 2022 22:54
MongoDB Cheat Sheet 2022

Interview Questions

MongoDB

Q1: Explain what is MongoDB? ☆

Answer: MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling. It's Key Features are:

  • Document Oriented and NoSQL database.
@webtroter
webtroter / Invoke-WireGuardRoutingHelper.ps1
Last active May 17, 2024 05:23
WireGuard Windows Routing Helper Script
[CmdletBinding(DefaultParameterSetName = "PreDown")]
param (
[Parameter(ParameterSetName = "Setup")]
[switch]
$Setup,
[Parameter(ParameterSetName = "Setup")]
[switch]
$RestartWGService,
# WireGuard Interface
[Parameter(Position = 0)]
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 17, 2024 05:23
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
/*
Tetris Move
Have the function TetrisMove(strArr) take strArr parameter being passed
which will be an array containing one letter followed by 12 numbers
representing a Tetris piece followed by the fill levels for the 12 columns
of the board.
Calculate the greatest number of horizontal lines that can be completed
when the piece arrives at the bottom assuming it is dropped immediately
after being rotated and moved horizontally from the top.
@mjbalcueva
mjbalcueva / password-input.tsx
Last active May 17, 2024 05:13
shadcn ui custom password input
"use client"
import { forwardRef, useState } from "react"
import { EyeIcon, EyeOffIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, InputProps } from "@/components/ui/input"
import { cn } from "@/lib/utils"
const PasswordInput = forwardRef<HTMLInputElement, InputProps>(
({ className, ...props }, ref) => {
@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 17, 2024 05:05
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

func scrollViewDidScroll(_ scrollView: UIScrollView) {
for (i, view) in scrollView.subviews.enumerated() {
var ty = 0.0
if scrollView.contentOffset.y < 0 {
// We're scrolling past the top of the scroll view.
// Translate each item in the scroll view by some amount based on its index and scroll offset.
ty = CGFloat(i) * abs(offsetY) / 8.0 * pow(1.12, CGFloat(i))
}
view.transform = CGAffineTransform(translationX: 0, y: ty)
}